package com.ldq.imooc.basics.io;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @Author : 李道泉
 * @Description :字符流读写
 * @Date : 2018/4/17 14:53
 * @Modified by :
 */
public class FrAndFwDemo {

    public static void main(String[] args) throws IOException {

        FileReader fr = new FileReader("F:\\IO\\io.txt");
        FileWriter fw = new FileWriter("F:\\IO\\io11.txt");

        char[] buffer = new char[2048];
        int c;
        while ((c = fr.read(buffer, 0, buffer.length)) != -1) {

            fw.write(buffer, 0, c);
            fw.flush();
        }
        fr.close();
        fw.close();
    }
}
